POV-Ray : Newsgroups : povray.general : Check this out!!! : Re: Check this out!!! Server Time
12 Aug 2024 17:19:11 EDT (-0400)
  Re: Check this out!!!  
From: Jerry Anning
Date: 23 Feb 1999 13:12:51
Message: <36d2ed6f.2561587@news.povray.org>
On 23 Feb 1999 08:29:08 -0500, par### [at] my-dejanewscom (Ron Parker)
wrote:

>On Mon, 22 Feb 1999 19:52:04 -0800, Ken <tyl### [at] pacbellnet> wrote:
>>Anthony Bennett wrote:

>>> I found a cool primitive that HAS got to be included in POV-Ray now! It
>>> is very cool!!!
>>> (Check out the upper folder [modelling], it has good stuff too).
>>> 
>>> http://www.mhri.edu.au/~pdb/modelling/supertoroid/
>>
>>I guess the equivelant would be a superellipsoid like object that takes
>>the form of a torus. I see possiblities for this shape. If not an official
>>primitive addition one of the patchs might pick it up. Nice of them to
>>provide the C code for it.
>
>Unfortunately, it doesn't provide what we really need: the equations for
>the intersection of one of these beasts with a line.  'Tis an interesting
>object, though, and I've bookmarked it for further investigation.

I coded it as a macro using the parametric object in SuperPatch.  For
some reason, it works fine with exponents of 1.0 (regular torus) but
gives garbage for any other exponent.  Is it the parametric object,
the equations in the referenced page or my bad coding?  I am going to
redo it as a mesh object with those equations and see what happens.
If anyone else wants to play with this, here is the macro I used.  To
repeat, it uses the SuperPatch.  Sorry about the underscores and
indenting, Ken!

// Begin POV code

// _Rj is major radius
// _Rn is minor radius
// _E1 and _E2 are exponents

#macro Supertoroid(_Rj, _Rn, _E1, _E2)
  parametric
    {
       function (cos(u) ^ _E1) * (_Rj + _Rn * (cos(v) ^ _E2)),
                     (sin(u) ^ _E1) * (_Rj + _Rn * (cos(v) ^ _E2)),
                     (sin(u) ^ _E2) *  _Rn
       <0, 0>, <2 * pi, 2 * pi>
       <-(_Rj + _Rn + .1), -(_Rj + _Rn + .1), -(_Rj +_Rn +.1)>,
          <_Rj +_Rn + .1, _Rj + _Rn + .1, _Rj + _Rn + .1>
       accuracy .001
       rotate <90, 0, 0>
    }
#end

// End POV code

Jerry Anning
clem "at" dhol "dot" com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.